package View;

import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.JTable;
import javax.swing.JButton;

import java.awt.Font;
import java.awt.event.ActionEvent;

public class UpdateCustomerView extends JFrame {
	 JTextField IdField;
	 JTable table;
	 JButton SearchBtn;
	 JButton BackBtn;
	
	public UpdateCustomerView() {
		getContentPane().setLayout(null);
		
		this.setTitle("Search Customer");
		this.setSize(436, 265);

		JLabel lblCustumerId = new JLabel("CustomerID");
		lblCustumerId.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblCustumerId.setBounds(91, 75, 109, 20);
		getContentPane().add(lblCustumerId);
		
		IdField = new JTextField();
		IdField.setBounds(215, 76, 135, 20);
		getContentPane().add(IdField);
		IdField.setColumns(10);
		
		SearchBtn = new JButton("Search");
		SearchBtn.setFont(new Font("Tahoma", Font.BOLD, 15));
		SearchBtn.setBounds(262, 169, 135, 28);
		getContentPane().add(SearchBtn);
		

	
		BackBtn = new JButton("Back");
		BackBtn.setFont(new Font("Tahoma", Font.BOLD, 15));
		BackBtn.setBounds(59, 169, 135, 28);
		getContentPane().add(BackBtn);
		
		JLabel lblSearchCustomerId = new JLabel("Search Customer ID in order to update ");
		lblSearchCustomerId.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblSearchCustomerId.setBounds(104, 27, 284, 20);
		getContentPane().add(lblSearchCustomerId);
	
		
		
		
	}
	
	public void updateCustomerListener(ActionListener actionListener){
		SearchBtn.addActionListener(actionListener);
		BackBtn.addActionListener(actionListener);
		
		
	}
	public void showWindow(){
		setVisible(true);
	}
	
	
	public void hideWindow(){
		setVisible(false);
	}
	
	public JButton getSearchBtn()
	{
		return this.SearchBtn;
	}
	public JButton getBackBtn()
	{
		return this.BackBtn;
	}

	/**
	 * @return ccnField Text 
	 */
	public String getID() {
		return IdField.getText();
	}


	public void clearFields(){
	
		IdField.setText("");		
	}

	public void  setID(){
		IdField.setText("");
	}
}
